package router

import (
	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
	"jgt-oper/src/context"
	"jgt-oper/src/web"
)

// WebUPEMap web-user-park-entrance 注册路由映射
func WebUPEMap(g *inject.Graph, r *gear.Router) {
	a := new(web.UPEController)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/user-park-entrance/page", context.WrapContext(a.QueryPage))
	r.Post("/user-park-entrance/query-park-entrance", context.WrapContext(a.QueryParkEntrance))
	r.Post("/user-park-entrance/add-park-entrance", context.WrapContext(a.AddParkEntrance))
	r.Get("/user-park-entrance/user-park-detail/:id", context.WrapContext(a.GetUserPark))
	r.Delete("/user-park-entrance/user-park-remove/:id", context.WrapContext(a.RemoveUserPark))
}
